$(document).ready(function() {

	Helper.doms.enterSub("password",function(){
		$("#password").blur();
		$("#login_a").click();
		$("#login_weixin").click();
	});

	$("#login_a").click(function(){
		$(this).blur();
		var uname = $("#username").val();
		var upass = $("#password").val();
		if(Helper.isEmpty(uname))
		{
			Helper.message("请输入登录用户名");
			return;
		}
		else if(Helper.isEmpty(upass))
		{
			Helper.message("请输入登录密码");
			return;
		}
		var flag = Helper.login.validata(uname,upass,null);
		if(flag) {
			Helper.login.login(uname,upass,null,null,function(json){
				Helper.message(json.message);
			});
		}
	});
	
	
	if($.cookie("memberstore_member_u") && $.cookie("memberstore_member_p")) {
		$("#username").val($.cookie("memberstore_member_u"));
		$("#password").val($.cookie("memberstore_member_p"));
		$("#remember_pass").attr("checked",true);
	}
	
	//忘记用户名
	var forgetNameW = new Helper.Window({
		id: "forget_name",
		title: "温馨提示:忘记用户名",
		url : Helper.basePath + "/page/user/forget_name.jsp",
		width: 450,
		height: 280,
		onSuccess:function(){
		}
	});
	$("#fogetName").click(function(){
		forgetNameW.show();
	});
	
});